package com.dotnet.modules.order.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.dotnet.modules.order.entity.Order;
import com.dotnet.modules.order.entity.OrderPageVo;
import com.dotnet.modules.order.mapper.OrderMapper;
import com.page.Pagination;

@Service
@Transactional
public class OrderServiceImpl implements OrderService{
	
	@Autowired
	private OrderMapper orderMapper;

	@Override
	public Order queryOne(Order record) {
		// TODO Auto-generated method stub
		return orderMapper.selectOne(record);
	}

	@Override
	public List<Order> queryAll(Order record) {
		// TODO Auto-generated method stub
		return orderMapper.select(record);
	}

	@Override
	public int queryCount(Order record) {
		// TODO Auto-generated method stub
		return orderMapper.selectCount(record);
	}

	@Override
	public Order queryByPrimaryKey(Object key) {
		// TODO Auto-generated method stub
		return orderMapper.selectByPrimaryKey(key);
	}

	@Override
	public int add(Order record) {
		// TODO Auto-generated method stub
		return orderMapper.insert(record);
	}

	@Override
	public int addSelective(Order record) {
		// TODO Auto-generated method stub
		return orderMapper.insertSelective(record);
	}

	@Override
	public int delete(Order record) {
		// TODO Auto-generated method stub
		return orderMapper.delete(record);
	}

	@Override
	public int deleteByPrimaryKey(Object key) {
		// TODO Auto-generated method stub
		return orderMapper.deleteByPrimaryKey(key);
	}

	@Override
	public int updateByPrimaryKey(Order record) {
		// TODO Auto-generated method stub
		return orderMapper.updateByPrimaryKey(record);
	}

	@Override
	public int updateByPrimaryKeySelective(Order record) {
		// TODO Auto-generated method stub
		return orderMapper.updateByPrimaryKeySelective(record);
	}

	@Override
	public int queryCountByExample(Order example) {
		// TODO Auto-generated method stub
		return orderMapper.selectCountByExample(example);
	}

	@Override
	public List<Order> queryByExample(Order example) {
		// TODO Auto-generated method stub
		return orderMapper.selectByExample(example);
	}
	
	@Override
	public Pagination pagelist(OrderPageVo order) {
		// TODO Auto-generated method stub
		Pagination pagination=new Pagination(order.getPageNo(),order.getPageSize(),pagecount(order));
		pagination.setList(orderMapper.pageList(order));
		return pagination;
	}

	@Override
	public int pagecount(OrderPageVo order) {
		// TODO Auto-generated method stub
		return orderMapper.pageCount(order);
	}
	
}
